/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jsnapshot;

/**
 *
 * @author kipe
 */
public class CornerPoints {

    private int x,  y,  w,  h;
    private int x1,  y1,  x2,  y2;

    public CornerPoints(int x1, int y1, int x2, int y2) {
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;
        conversion();
    }

    private void conversion() {
        if (x1 < x2) {
            x = x1;
            y = y1;
            w = Math.abs(x2 - x1);
            h = Math.abs(y2 - y1);
        } else {
            x = x2;
            y = y2;
            w = Math.abs(x2 - x1);
            h = Math.abs(y2 - y1);
        }
    }

    /**
     * @return the x
     */
    public int getX() {
        return x;
    }

    /**
     * @return the y
     */
    public int getY() {
        return y;
    }

    /**
     * @return the w
     */
    public int getW() {
        return w;
    }

    /**
     * @return the h
     */
    public int getH() {
        return h;
    }
}
